home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / memory / src / freevec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.2 KB  |  63 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id: freevec.c 1.1 1995/11/14 22:31:07 digulla Exp digulla $
  4.     $Log: freevec.c $
  5.  * Revision 1.1  1995/11/14  22:31:07  digulla
  6.  * Initial revision
  7.  *
  8.     Desc:
  9.     Lang: english
  10. */
  11. #include "exec_intern.h"
  12. #include "memory.h"
  13.  
  14. /*****************************************************************************
  15.  
  16.     NAME */
  17.     #include <clib/exec_protos.h>
  18.  
  19.     __AROS_LH1(void, FreeVec,
  20.  
  21. /*  SYNOPSIS */
  22.     __AROS_LA(APTR, memoryBlock, A1),
  23.  
  24. /*  LOCATION */
  25.     struct ExecBase *, SysBase, 115, Exec)
  26.  
  27. /*  FUNCTION
  28.     Free some memory allocated with allocvec.
  29.  
  30.     INPUTS
  31.     memoryBlock - The memory to be freed. It is safe to free a NULL pointer.
  32.  
  33.     RESULT
  34.  
  35.     NOTES
  36.  
  37.     EXAMPLE
  38.  
  39.     BUGS
  40.  
  41.     SEE ALSO
  42.     AllocVec()
  43.  
  44.     INTERNALS
  45.  
  46.     HISTORY
  47.     15-10-95    created by m. fleischer
  48.     26-10-95    digulla adjusted to new calling scheme
  49.  
  50. ******************************************************************************/
  51. {
  52.     __AROS_FUNC_INIT
  53.     /* If there's nothing to free do nothing. */
  54.     if (memoryBlock != NULL)
  55.     {
  56.     UBYTE * ptr = (UBYTE *) memoryBlock;
  57.  
  58.     ptr -= ALLOCVEC_TOTAL;
  59.     FreeMem (ptr, *(ULONG *)ptr);
  60.     }
  61.     __AROS_FUNC_EXIT
  62. } /* FreeVec */
  63.